<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>客户管理</title>

    <!--引入 element-ui 的样式，-->
    <link rel="stylesheet" href="/admin/plugin/element-ui/index.css">
    <!-- 必须先引入vue，  后使用element-ui -->
    <script type="text/javascript" src="/admin/js-css/js/vue.min.js"></script>
    <!-- 引入element 的组件库-->
    <script type="text/javascript" src="/admin/plugin/element-ui/index.js"></script>

    <script type="text/javascript" src="/admin/plugin/element-ui/httpVueLoader.js"></script>

    <!--引入layui组件-->
    <link rel="stylesheet" href="/admin/plugin/layui/dist/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css"  media="all">
    <script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>

    <script type="text/javascript" src="/admin/js-css/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/admin/js-css/js/mx1.0.js?v=1.1"></script>
    <script type="text/javascript" src="/admin/html/module/aketaoshuiliju/kehu/common.js?v=1.04"></script>
    <script type="text/javascript" src="/admin/html/module/shuiwu/kehu/tuikuan.js?v=1.0"></script>



    <style type="text/css">
        .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
            margin-bottom: 3px;
        }
        .el-form-item--small .el-form-item__content, .el-form-item--small .el-form-item__label {
            padding-right: 0px;
        }
        .el-tooltip__popper{ max-width:20%; }
        .el-tooltip__popper{
            display: none;
        }

        .el-table{
            /*font-weight: bold;*/
            overflow: visible !important;
        }

        .layui-table-click {
            background-color:cadetblue !important;
            color:white;
        }

        ::-webkit-scrollbar {
            width: 6px;
            height: 10px;
            background-color: rgba(255, 255, 255, 0.1);
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(144, 147, 153, .3);
            border-radius: 4px;
            cursor: pointer;
        }
        .layui-form-label {
            float: left;
            display: block;
            padding: 7px 1px;
            width: 100px;
            font-weight: 400;
            line-height: 14px;
            text-align: right;
        }

        /**输入框高度设置**/
        .layui-input, .layui-select, .layui-textarea {
            height: 30px;
            line-height: 30px\9;
        }
        /**按钮样式设置**/
        .layui-btn {
            height: 30px;
            line-height: 30px;
            font-size: 13px;
        }
        .layui-btn+.layui-btn {
            margin-left: 0px;
        }

        .layui-table, .layui-table-view {
            margin: 0px 0;
        }

        .changeLHight .el-form-item__label{
            line-height: 16px !important;
        }

        /**列表内容超出自动换行**/
        /*.layui-table-cell {
            height: auto;
            overflow:visible;white-space:normal;text-overflow:clip;
            word-break: break-all;
        }*/


        /* 列表样式修改*/
        /* 去掉最下面的那一条线 */
        .el-table::before {
            height: 0px;
        }

        /* 表格斑马自定义颜色 */
        .el-table__row.warning-row {
            background: #F1F1F1;
        }

        /* 合计颜色重置 */
        .el-table__footer-wrapper tbody td.el-table__cell {
            background: #fff;
        }

        table {
            border-color: black !important;
        }

        /** 改变边框颜色 */
        /* .el-table--border,
        .el-table--group {
            border: 1px solid #CCCCCC !important;
        } */

        /** 改变表格内竖线颜色 */
        .el-table--border td,
        .el-table--border th,
        .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed {
            border-right: 1px solid #CCCCCC !important;
        }

        /** 改变表格内行线颜色 */
        .el-table td,
        .el-table th.is-leaf {
            border-bottom: 1px solid #CCCCCC !important;
        }

        .el-table thead tr th {
            border-color: #8c939d;

        }
        .el-table th.el-table__cell{
            background: #f5f7fa;
        }
        .el-table thead {
            color: #606266;
        }
        .el-table td{
            font-size: 14px;
            background: #dfefff6b;
        }

        .el-divider--horizontal {
            margin: 12px 0px;
        }
    </style>

</head>
<body>
<div id="app">
    <div id="topdiv">
        <div class="demoTable" style="padding: 5px;"  v-if="searchIsShow"  >
            <el-form :inline="true" size="mini"   ref="listSearch"   >
                <el-form-item  :label="item.lable+'：'"  v-for="(item,index) in listSearch" :style="'display:'+item.isHide" >
                    <!--模糊搜索-->
                    <template  v-if="item.gs == '' || item.gs=='0' || item.gs=='4' || item.gs == '6'"  >

                        <template v-if="item.type == '0'">
                            <template v-if="item.key == 'qyid'">
                                <el-input @focus="select_quyu"  style="width:180px;display: none;" v-model="searchInputDtos[item.key].value"  ></el-input>
                                <el-input @focus="select_quyu"  style="width:180px;" v-model="quyuName"  ></el-input>

                            </template>
                            <template v-else >
                                <el-input style="width:180px" v-model="searchInputDtos[item.key].value"  ></el-input>
                            </template>
                        </template>

                        <!--下拉框多选-->
                        <template v-if="item.type == '6' || item.type=='8'" >
                            <el-select  multiple :placeholder="item.lable"
                                        filterable style="width:180px"
                                        v-model="searchInputDtos[item.key].values"  >
                                <el-option value="" ></el-option>
                                <el-option :value="vm.value"  :label="vm.showValue" v-for="vm in item.searchTypeForSelectDtos">{{vm.showValue}}</el-option>
                            </el-select>
                        </template>

                        <template v-if="item.type == '11'" >
                            <el-cascader  :ref="item.key" size="mini" @change="handleChange(item.key)" clearable
                                          v-model="searchInputDtos[item.key].value"  :props="cascaderProps[item.key]"
                            ></el-cascader>
                        </template>

                        <!--日期框-->
                        <template v-if="item.type == '1'">
                            <el-date-picker value-format="yyyy-MM-dd"
                                            v-model="searchInputDtos[item.key].value"  style="width:180px"
                                            type="date" >
                            </el-date-picker>
                        </template>

                        <!--日期框时分秒-->
                        <template v-if="item.type == '5'">
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
                                            v-model="searchInputDtos[item.key].value"  style="width:180px"
                                            type="datetime" >
                            </el-date-picker>
                        </template>

                    </template>

                    <!--大于小于输入框-->
                    <template  v-if="item.gs=='1'"  >
                        <template v-if="item.type == '0'">
                            <el-input style="width:180px"  v-model="searchInputDtos[item.key].searchTypeForDateDto.start"  ></el-input>
                            <el-input style="width:180px"  v-model="searchInputDtos[item.key].searchTypeForDateDto.end"  ></el-input>
                        </template>

                        <!--下拉框多选-->
                        <template v-if="item.type == '6' || item.type=='8'" >
                            <el-select filterable style="width:180px"
                                       v-model="searchInputDtos[item.key].searchTypeForDateDto.start" >
                                <el-option value="" ></el-option>
                                <el-option :value="vm.value" :label="vm.showValue" v-for="vm in item.searchTypeForSelectDtos">{{vm.showValue}}</el-option>
                            </el-select>

                            <el-select  filterable style="width:180px"
                                        v-model="searchInputDtos[item.key].searchTypeForDateDto.end" >
                                <el-option value="" ></el-option>
                                <el-option :value="vm.value" :label="vm.showValue" v-for="vm in item.searchTypeForSelectDtos">{{vm.showValue}}</el-option>
                            </el-select>
                        </template>

                        <template v-if="item.type == '11'" >
                            <el-cascader  :ref="item.key" size="mini" @change="handleChange(item.key)" clearable
                                          v-model="searchInputDtos[item.key].searchTypeForDateDto.start" :props="cascaderProps[item.key]"
                            ></el-cascader>
                            <el-cascader  :ref="item.key" size="mini" @change="handleChange(item.key)" clearable
                                          v-model="searchInputDtos[item.key].searchTypeForDateDto.end" :props="cascaderProps[item.key]"
                            ></el-cascader>
                        </template>

                        <!--日期框-->
                        <template v-if="item.type == '1'">
                            <el-date-picker value-format="yyyy-MM-dd"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.start" style="width:180px"
                                            type="date" >
                            </el-date-picker>
                            <el-date-picker value-format="yyyy-MM-dd"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.end" style="width:180px"
                                            type="date" >
                            </el-date-picker>
                        </template>

                        <!--日期框时分秒-->
                        <template v-if="item.type == '5'">
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.start" style="width:180px"
                                            type="datetime" >
                            </el-date-picker>
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.end" style="width:180px"
                                            type="datetime" >
                            </el-date-picker>
                        </template>

                    </template>

                    <!--大于条件-->
                    <template  v-if="item.gs=='2'"  >
                        <template v-if="item.type == '0'">
                            <el-input style="width:180px"  v-model="searchInputDtos[item.key].searchTypeForDateDto.start"  ></el-input>
                        </template>

                        <!--下拉框多选-->
                        <template v-if="item.type == '6' || item.type=='8'" >
                            <el-select filterable style="width:180px"
                                       v-model="searchInputDtos[item.key].searchTypeForDateDto.start" >
                                <el-option value="" ></el-option>
                                <el-option :value="vm.value" :label="vm.showValue" v-for="vm in item.searchTypeForSelectDtos">{{vm.showValue}}</el-option>
                            </el-select>
                        </template>

                        <template v-if="item.type == '11'" >
                            <el-cascader  :ref="item.key" size="mini" @change="handleChange(item.key)" clearable
                                          v-model="searchInputDtos[item.key].searchTypeForDateDto.start" :props="cascaderProps[item.key]"
                            ></el-cascader>
                        </template>

                        <!--日期框-->
                        <template v-if="item.type == '1'">
                            <el-date-picker value-format="yyyy-MM-dd"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.start" style="width:180px"
                                            type="date" >
                            </el-date-picker>
                        </template>

                        <!--日期框时分秒-->
                        <template v-if="item.type == '5'">
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.start" style="width:180px"
                                            type="datetime" >
                            </el-date-picker>
                        </template>

                    </template>

                    <!--小于条件-->
                    <template  v-if="item.gs=='3'"  >
                        <template v-if="item.type == '0'">
                            <el-input style="width:180px"  v-model="searchInputDtos[item.key].searchTypeForDateDto.end"  ></el-input>
                        </template>

                        <!--下拉框多选-->
                        <template v-if="item.type == '6' || item.type=='8'" >

                            <el-select  filterable style="width:180px"
                                        v-model="searchInputDtos[item.key].searchTypeForDateDto.end" >
                                <el-option value="" ></el-option>
                                <el-option :value="vm.value"  :label="vm.showValue" v-for="vm in item.searchTypeForSelectDtos">{{vm.showValue}}</el-option>
                            </el-select>
                        </template>

                        <template v-if="item.type == '11'" >
                            <el-cascader  :ref="item.key" size="mini" @change="handleChange(item.key)" clearable
                                          v-model="searchInputDtos[item.key].searchTypeForDateDto.end" :props="cascaderProps[item.key]"
                            ></el-cascader>
                        </template>

                        <!--日期框-->
                        <template v-if="item.type == '1'">
                            <el-date-picker value-format="yyyy-MM-dd"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.end" style="width:180px"
                                            type="date" >
                            </el-date-picker>
                        </template>

                        <!--日期框时分秒-->
                        <template v-if="item.type == '5'">
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
                                            v-model="searchInputDtos[item.key].searchTypeForDateDto.end" style="width:180px"
                                            type="datetime" >
                            </el-date-picker>
                        </template>

                    </template>

                </el-form-item>

                <el-form-item v-if="JSON.stringify(listSearch) != '{}' " >
                    <span class="layui-btn" v-if="searchIsShow" onclick="vm.getListdata()">搜索</span>
                    <span class="layui-btn" v-if="searchIsShow" onclick="vm.f_search_advanced()">高级检索</span>
                    <span class="layui-btn" v-if="searchIsShow" onclick="vm.f_search_custom()">自定义搜索</span>
                    <span v-if="searchIsShow" class="layui-btn"  onclick="vm.searchShowHide()">收起</span>

                </el-form-item>
            </el-form>
        </div>

        <!-- 分割线-->
        <el-divider  v-if="searchIsShow"  ></el-divider>
        <el-row style="margin-bottom: 4px;" >
            <template v-for="item in buttons"  >
                <template v-if="!item.custom">
                    <el-button type="primary" style="margin-left: 1px;" v-if="item.type == 0" :item="JSON.stringify(item)" size="small" :icon="item.icon_path"  onclick="vm.f_add(this)">{{item.name}}</el-button>
                    <el-button type="primary" style="margin-left: 1px;" v-if="item.type == 1" :item="JSON.stringify(item)"  size="small" :icon="item.icon_path" up=true   onclick="vm.f_update(this)">{{item.name}}</el-button>
                    <el-button type="primary" style="margin-left: 1px;" v-if="item.type == 2" :item="JSON.stringify(item)" size="small"  :icon="item.icon_path"  onclick="vm.f_delete(this)">{{item.name}}</el-button>
                    <el-button type="primary" style="margin-left: 1px;" v-if="item.type == 3" :item="JSON.stringify(item)" size="small"  :icon="item.icon_path"  onclick="vm.f_post_confirm(this)">{{item.name}}</el-button>
                    <el-button type="primary" style="margin-left: 1px;"  v-if="item.type == 4" :icon="item.icon_path" size="small"   onclick="vm.f_set_list()">列表自定义</el-button>
                    <el-button type="primary" style="margin-left: 1px;"  v-if="item.type == 5" :icon="item.icon_path"  size="small"  onclick="vm.f_set_input()">录入自定义</el-button>
                    <el-button type="primary"  style="margin-left: 1px;" v-if="item.type == 6" :icon="item.icon_path"  size="small"  onclick="vm.f_set_order()">排序自定义</el-button>
                    <el-button type="primary"  style="margin-left: 1px;" v-if="item.type == 7" :icon="item.icon_path" size="small"  :item="JSON.stringify(item)"  onclick="vm.f_exp(this)">{{item.name}}</el-button>
                    <el-button type="primary"  style="margin-left: 1px;" v-if="item.type == 8" :icon="item.icon_path" size="small"  :item="JSON.stringify(item)"  onclick="vm.exportLocal(this)">{{item.name}}</el-button>

                </template>

                <template v-if="item.custom" >
                    <el-button type="primary" :icon="item.icon_path" style="margin-left: 1px;"  :item="JSON.stringify(item)" size="small"    @click="vm.callFunModule(item.custom_data_zygl_id)"  >{{item.name}}</el-button>
                </template>

            </template>

            <el-button v-if="!searchIsShow" style="margin-left: 0px;"  icon="el-icon-search" type="primary" size="small" @click="vm.searchShowHide()">搜索</el-button>

        </el-row>
    </div>


    <el-table
            :data="tableData"
            ref="tipsTable"
            size="mini"
            :height="tableHeight"
            @selection-change="handleSelectionChange"
            @row-click="rowClick"
            @sort-change="sortChange"
            :row-style="rowClass"
            @cell-dblclick="cellDblclick"
            border
            style="width: 100%">
        <el-table-column
                type="selection"
                width="55">
        </el-table-column>

        <el-table-column v-for="(item,index) in listColumn"
                         :prop="item.col_name"
                         :label="item.show_name"
                         sortable="custom"
                         :show-overflow-tooltip="true"
                         :width="item.minWidth" >
            <template  slot-scope="scope">
                <template  v-if="item.col_style == '4'" >
                    <span @click="openImageurl(scope.row[item.col_name])" style='margin: 0 5px;' v-for="(src,index1) in scope.row[item.col_name].split(',')" ><img :src="src"   width="30px" height="30px" /></span>
                </template>
                <template v-else >{{scope.row[item.col_name]}}</template>
            </template>

        </el-table-column>


    </el-table>

    <el-pagination
            background
            @current-change="handleCurrentChange"
            @size-change="sizeChange"
            layout="prev, pager, next,total,sizes"
            :page-size="pageSize"
            :page-sizes="pageSizes"
            :total="total">
    </el-pagination>
</div>
</body>
<script>
    var vm = new Vue({
        el:"#app",
        data:{
            tableId:top.data.tableId,
            listSearch: {}//默认查询的字段
            , searchInputDtos: {},
            buttons: [],
            listColumn:[],
            tableData: [],
            multipleSelection: [],
            cascaderProps:{},//三级联动动态加载
            parmsData:{},
            keycode:"",
            tableHeight:0,
            updateButtonItem:{},//修改按钮上面的item属性值
            //选择行变颜色参数
            chooseArr:[],
            selectRow: [],
            orderBy:"",
            //分页参数
            pageNumber:1,
            total:0,
            pageSize:50,
            pageSizes:[10,20,50,100,200,500,1000],
            quyuName:"",
            //搜索栏是否显示
            searchIsShow:true,
        },
        created(){
            this.parmsData = getParams();
            if(this.parmsData.tableId != undefined){
                this.tableId = getTableId(this.parmsData.tableId);
            }

            let userstr = localStorage.getItem("user");
            if(userstr!=undefined && userstr!=""){
                let user = JSON.parse(userstr);
                let keycode = user.org_id;
                if(keycode!=undefined && keycode!=""){
                    this.keycode = keycode;
                }
            }
            this.getHead();
        },
        methods:{
            callFunModule(methodName){
                this[methodName]();
            },
            //查看图片
            openImageurl(url){
                let openurl = "/admin/html/dataManagement/img_show.html?img="+url;
                top.f_layer_open_get(openurl,'80%','70%','',null,'图片查看',null);
            },
            //搜索栏显示与展开
            searchShowHide(){
                if(this.searchIsShow){
                    this.searchIsShow = false;
                }else {
                    this.searchIsShow = true;
                }
                this.$nextTick(function (){
                    //设置表格的高度
                    vm.setTableHeight();
                })

            },
            setTableHeight(){
                //设置表格的高度
                vm.tableHeight = parseInt(top.document.documentElement.scrollHeight)-$("#topdiv").height()-146;
            },
            //移动
            yidong(){
                let btn = {btn: ['确定', '取消']
                    ,yes: async function(index, layero){
                        //按钮【按钮一】的回调
                        var win = getTopIframe(layero); //得到iframe页的窗口对象，执行iframe页的方法：
                        var data = win.getDataNodes();
                        if(data.length != 1){
                            top.alert("请选择一个节点！");
                            return ;
                        }
                        if(vm.multipleSelection.length == 0){
                            top.alert("请选择记录！");
                            return;
                        }
                        top.load();
                        const res = await postWebCustom(getTableId("1922"),{ids:""+vm.multipleSelection,qyid:data[0].id});
                        top.layer.closeAll();
                        top.alert(res.msg);
                        vm.getListdata();
                    }
                    ,btn2: function(index, layero){
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }};
                top.f_layer_open_get("/admin/html/module/shuiwu/kehu/quyuTree.html","30%","80%",function () {

                },btn,"客户移动区域", {});
            },
            //选择区域
            select_quyu(){
                let btn = {btn: ['确定', '取消']
                    ,yes: function(index, layero){
                        //按钮【按钮一】的回调
                        var win = getTopIframe(layero); //得到iframe页的窗口对象，执行iframe页的方法：
                        var data = win.getDataNodes();
                        if(data.length != 1){
                            top.alert("请选择一个节点！");
                            return ;
                        }
                        vm.searchInputDtos["qyid"].value = data[0].id;
                        vm.quyuName = data[0].title;
                        top.layer.close(index);
                    }
                    ,btn2: function(index, layero){
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }};
                top.f_layer_open_get("/admin/html/module/shuiwu/kehu/quyuTree.html","30%","80%",function () {

                },btn,"选择区域", {});
            },
            //自定义排序
            sortChange(column){
                if(column.order == "ascending"){
                    this.orderBy = column.prop+" asc ";
                }else if(column.order == "descending"){
                    this.orderBy = column.prop+" desc ";
                }
                this.getListdata();
            },
            //当单元格被双击时触发
            cellDblclick(cell){
                if(Object.keys(this.updateButtonItem).length == 0){
                    this.f_view(cell.id);
                }else {
                    this.f_upex(this.updateButtonItem,cell.id);
                }
            },
            //每页记录数改变
            sizeChange(val){
                this.pageSize = val;
                this.getListdata();
            },
            //开始翻页
            handleCurrentChange(val){
                this.pageNumber = val;
                this.getListdata();
            },
            // 点击表格行
            rowClick(row) {
                this.$refs.tipsTable.toggleRowSelection(row);
            },
            // 多选高亮选中行
            rowClass({row, rowIndex}){
                if(this.selectRow.includes(rowIndex)){
                    return { "background-color": "#5aabff" }
                }
            },
            handleSelectionChange(val) {
                this.chooseArr = val;
                this.multipleSelection = [];
                for(let a=0;a<val.length;a++){
                    this.multipleSelection.push(val[a].id);
                }
            },
            async getHead(){
                const res = await postBody("/admin/api/DataManagementController/getCustomFields", {tableId: this.tableId,mapdata:top.data.treeNodeObj});
                this.listColumn = res.data.listColumn;
                this.listSearch = res.data.listSearch;
                this.searchInputDtos = res.data.listSearch;
                //设置按钮
                vm.buttons = res.data.buttons;
                for(let a=0;a<vm.buttons.length;a++){
                    let btn = vm.buttons[a];
                    if(btn.type == "1"){
                        this.updateButtonItem = btn;
                        break;
                    }
                }
                //动态加载三级联动
                for(let itemKey in vm.listSearch){
                    let itemDto = vm.listSearch[itemKey];
                    if(itemDto.type == "11"){
                        vm.cascaderProps[itemDto.key] = {//三级联动动态加载
                            lazy: true,
                            checkStrictly : true,
                            async lazyLoad (node, resolve){
                                console.log("node:",node);
                                let pid = "0000";
                                if(node.level != '0'){
                                    pid = node.data.value;
                                }
                                const res = await listAdmin(itemDto.data_zygl_id,"id",{pid:pid});
                                let nodes = [];
                                let nodesList = res.data;
                                for(let c=0;c<nodesList.length;c++){
                                    nodes.push({value:nodesList[c][itemDto.select_v],label:nodesList[c][itemDto.select_text],level:1});
                                }

                                resolve(nodes);
                            }
                        }
                    }
                }

                //头部渲染完成后，开始设置表格的高度
                vm.$nextTick(function (){
                    //设置表格的高度
                    vm.tableHeight = parseInt(document.documentElement.scrollHeight)-$("#topdiv").height()-40;
                });
                this.getListdata();
            },
            async getListdata(){
                let listother = {};
                copy(top.data.treeNodeObj,listother);
                copy({ids:top.data.param.ids},listother);
                top.data.listother = listother;
                let parm = {
                    orderBy: this.orderBy,
                    tableId: this.tableId,
                    searchInputDtos: vm.searchInputDtos,
                    other: listother,
                    pageNumber:""+this.pageNumber,
                    pageSize : ""+this.pageSize
                }
                let i = load();
                const res = await postBody("/admin/api/DataManagementController/list",parm);
                layer.close(i);
                if(res.code == 0){
                    top.alert(res.msg);
                    return;
                }
                this.tableData = res.data.rows;
                this.total = parseInt(res.data.total);
                this.pageSize = parseInt(res.data.pageSize);
            },
            f_search_advanced() {
                let btn = {
                    btn: ['确定', '取消']
                    , yes: function (index, layero) {
                        //按钮【按钮一】的回调
                        let win = getTopIframe(layero);
                        let data = win.getData();
                        top.layer.closeAll();
                        vm.searchInputDtos = data;
                        vm.getListdata();
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };
                top.f_layer_open_get("/admin/html/dataManagement/advancedRetrieval.html", "40%", "60%", function () {

                }, btn, "高级检索")
            },
            f_set_list() {
                let btn = {
                    btn: ['关闭']
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };
                top.data.custom = "IS_LIST";
                top.f_layer_open_get("/admin/html/dataManagement/custom_list.html", "80%", "65%", function () {

                }, btn, "列表自定义")
            },
            f_set_order(){
                let btn = {
                    btn: ['保存','关闭'],
                    yes: function (index, layero){
                        var win = getTopIframe(layero);
                        let data = win.getData();
                        let i = top.layer.load();
                        postBody("/admin/api/SortCustomManagementController/saveCustomSortData", {list:data}, function (res) {
                            top.layer.close(i);
                            top.alert(res.msg);
                            vm.getListdata();
                        })
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };
                top.f_layer_open_get("/admin/html/dataManagement/custom_order.html?tableId="+top.data.zygl_id, "60%", "65%", function () {

                }, btn, "排序自定义")
            },
            f_set_input() {
                let btn = {
                    btn: ['关闭']
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };
                top.data.custom = "IS_INPUT";
                top.f_layer_open_get("/admin/html/dataManagement/custom_search.html", "80%", "65%", function () {

                }, btn, "录入自定义")
            },
            f_search_custom() {
                let btn = {
                    btn: ['关闭']
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };
                top.data.custom = "IS_SEARCH";
                top.f_layer_open_get("/admin/html/dataManagement/custom_search.html", "80%", "65%", function () {

                }, btn, "自定义搜索")
            },
            async f_exp(o){
                let btn = {
                    btn: ['关闭']
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };
                let item = $(o).attr("item");
                console.log("item_add:"+item);
                item = JSON.parse(item);
                let listother = {};
                try {
                    copy(top.data.treeNodeObj,listother);
                    copy({ids:top.data.param.ids},listother);
                }catch (e){}
                top.data.listother = listother;
                const res = await postBody("/admin/api/DataManagementController/expExcel",{searchInputDtos:vm.searchInputDtos,tableId:item.custom_data_zygl_id,other:listother});
                top.alert(res.msg);
                top.f_layer_open_get("/admin/html/dataManagement/expexcel-getpro.html", "60%", "25%", function () {

                }, btn, "数据导出")
            },
            //修改客户信息
            async xiugai(){
                if(this.multipleSelection.length != 1){
                    top.alert("请选择一条记录进行修改！");
                    return;
                }
                //查詢客戶信息
                const resq = await queryDataForId(getTableId("931"),""+this.multipleSelection);
                if(resq.code == 0){
                    top.alert(resq.msg);
                    return;
                }
                let btn = {
                    btn: ['确定', '取消']
                    , yes:async function (index, layero) {
                        //按钮【按钮一】的回调
                        let win = getTopIframe(layero);
                        let issubmit = win.verification();
                        if (!issubmit) {
                            return false;
                        }
                        let data = win.getData();
                        let i = top.load();
                        //保存数据到数据库
                        const czres = await updateMapdata(getTableId("931"),data);
                        if(czres.code == 0){
                            top.layer.close(i);
                            top.alert(czres.msg);
                            return;
                        }
                        top.layer.closeAll();
                        top.alert(czres.msg);
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };

                top.f_layer_open_get("/admin/html/module/shuiwu/kehu/input_select_quyu.html?tableId="+getTableId("931"), "70%", "68%", function () {
                    vm.getListdata();
                }, btn, "修改客户信息",resq.data);
            },
            //客户换表
            async kehuhuanbiao(){
                if(this.multipleSelection.length != 1){
                    top.alert("请选择一条记录进行换表！");
                    return;
                }
                //查詢客戶信息
                const getresdata = await postWebCustom(getTableId("916"),{id:""+this.multipleSelection});
                let btn = {
                    btn: ['确定', '取消']
                    , yes:async function (index, layero) {
                        //按钮【按钮一】的回调
                        let win = getTopIframe(layero);
                        let issubmit = win.verification();
                        if (!issubmit) {
                            return false;
                        }
                        let data = win.getData();
                        let i = top.load();

                        //调用开户接口
                        let kplx = Object.values(data)[1]["kplx"];
                        const khlocal = await postWebCustom(getTableId("906"),{kid:kplx,fromdata:JSON.stringify(data),ishuanbiao:"true"});
                        if(khlocal.code == 0){
                            top.layer.close(i);
                            top.alert(khlocal.msg);
                            return ;
                        }

                        //开始调用本地读写卡服务
                        const reskh = await postBodyNotHeaders(khlocal.data.dyjk,JSON.parse(khlocal.data.parms));
                        const parsres = await postWebCustom(getTableId("908"),{mapset:JSON.stringify(khlocal.data),res:JSON.stringify(reskh)});
                        if(parsres.code == 0){
                            top.layer.close(i);
                            top.alert(parsres.msg);
                            return ;
                        }

                        //开始保存数据库
                        let map1 = Object.values(data)[1];
                        map1["sys_code"] = khlocal.data.sysCode;
                        map1["user_code"] = khlocal.data.userCode;

                        // map1["sys_code"] = "1";
                        // map1["user_code"] = "9978";
                        let key1 = Object.keys(data)[1];
                        data[key1] = map1;

                        //卡片充值成功后保存数据到数据库
                        const czres = await postWebCustom(getTableId("918"),{jsontext:JSON.stringify(data)});
                        if(czres.code == 0){
                            top.layer.close(i);
                            top.alert(czres.msg);
                            return;
                        }
                        top.layer.closeAll();
                        top.alert(czres.msg);
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };

                top.f_layer_open_get("/admin/html/module/shuiwu/kehu/jiaofeiInput.html?tableId="+getTableId("915"), "80%", "80%", function () {

                }, btn, "客户换表",getresdata.data);
            },
            //客户补卡
            async kehubuka(){
                if(this.multipleSelection.length != 1){
                    top.alert("请选择一条记录进行补卡！");
                    return;
                }
                //查詢客戶信息
                const getresdata = await postWebCustom(getTableId("912"),{id:""+this.multipleSelection});
                let btn = {
                    btn: ['确定', '取消']
                    , yes:async function (index, layero) {
                        //按钮【按钮一】的回调
                        let win = getTopIframe(layero);
                        let issubmit = win.verification();
                        if (!issubmit) {
                            return false;
                        }
                        let data = win.getData();
                        let i = top.load();
                        //获取本地调用购买接口地址
                        let khid = Object.values(data)[0]["id"];
                        let gml = Object.values(data)[1]["gml"];
                        const reslocal = await postWebCustom(getTableId("907"),{"khid":""+khid,bugvalue:""+gml,fromdata:JSON.stringify(data)});
                        if(reslocal.code == 0){
                            top.layer.close(i);
                            top.alert(reslocal.msg);
                            return ;
                        }

                        //开始调用本地读写卡服务
                        let localurl = reslocal.data["dyjk"];
                        let pdata = JSON.parse(reslocal.data["parms"]);
                        const res = await postBodyNotHeaders(localurl,pdata);
                        const parsres = await postWebCustom(getTableId("908"),{mapset:JSON.stringify(reslocal.data),res:JSON.stringify(res)});
                        if(parsres.code == 0){
                            top.layer.close(i);
                            top.alert(parsres.msg);
                            return ;
                        }

                        //卡片充值成功后保存数据到数据库
                        const czres = await postWebCustom(getTableId("913"),{jsontext:JSON.stringify(data)});
                        if(czres.code == 0){
                            top.layer.close(i);
                            top.alert(czres.msg);
                            return;
                        }
                        top.layer.closeAll();
                        top.alert(czres.msg);
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };

                top.f_layer_open_get("/admin/html/module/shuiwu/kehu/jiaofeiInput.html?tableId="+getTableId("911"), "80%", "80%", function () {

                }, btn, "客户补卡",getresdata.data);
            },



            //物联网充值
            async wulianwangchongzhi(){
                if(this.multipleSelection.length != 1){
                    top.alert("请选择一条记录进行充值！");
                    return;
                }
                let i = top.load();
                //查詢客戶信息
                const getresdata = await postWebCustom(getTableId("1902"),{id:""+this.multipleSelection});
                top.layer.close(i);
                if(getresdata.code == 0){
                    top.alert(getresdata.msg);
                    return;
                }

                //保存表内剩余
                top.data.parsres1 = {
                    data:{
                        shengyu:getresdata.data.shengyu
                    }
                }

                let btn = {
                    btn: ['确定', '取消']
                    , yes:async function (index, layero) {
                        //按钮【按钮一】的回调
                        let win = getTopIframe(layero);
                        let issubmit = win.verification();
                        if (!issubmit) {
                            return false;
                        }
                        let data = win.getData();
                        let i = top.load();
                        const czres = await postWebCustom(getTableId("1941"),{jsontext:JSON.stringify(data),is_wlw:"1"});
                        if(czres.code == 0){
                            top.layer.close(i);
                            top.alert(czres.msg);
                            return;
                        }
                        top.layer.closeAll();
                        top.alert(czres.msg);
                        vm.getListdata();
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                };

                top.f_layer_open_get("/admin/html/module/shuiwu/kehu/jiaofeiInput.html?tableId="+getTableId("901"), "80%", "80%", function () {

                }, btn, "物联网充值",getresdata.data);
            },
            //读卡充值
            dukachongzhi(){
                fun.dukachongzhi();
            },
            //读卡充值
            async dukachongzhi_local(){
                let kid = "";
                //获取所有读卡接口
                let dukares = await postWebCustom(getTableId("1960"),{});
                if(dukares.data.length == 0){
                    layer.alert("没有读卡接口！");
                    return;
                }

                let dukadata = dukares.data;
                for(let la in dukadata){
                    try {
                        let urlmap = dukadata[la];
                        const reslocal = await postBodyNotHeaders(urlmap.url,JSON.parse(urlmap["parms"]));

                        let usercode = "";
                        eval(urlmap.usercode);
                        let mapkh = await postWebCustom(getTableId("1961"),{usercode:""+usercode});
                        console.log("mapkh",mapkh);
                        if(mapkh.code == 1){
                            kid = mapkh.data.kplx;
                            break;
                        }
                    }catch (e){
                        console.log(e);
                    }
                }

                if(kid == ""){
                    layer.alert("未读取到卡片信息!");
                    return;
                }

                //上次是否刷卡标志
                let shangci_shuaka = true;
                let userCode = "";
                let i = top.load();
                //获取读卡的调用所有接口
                const res = await postWebCustom(getTableId("921"),{kid:""+kid});
                if(res.code == 0){
                    layer.close(i);
                    alert(res.msg);
                    return ;
                }
                let listurl = res.data.list;
                if(listurl.length == 2){//如果要调用两个读卡接口
                    console.log(listurl[0]["dyjk"])
                    const reslocal = await postBodyNotHeaders(listurl[0]["dyjk"],{});
                    const parsres = await postWebCustom(getTableId("908"),{mapset:JSON.stringify(listurl[0]),res:JSON.stringify(reslocal)});
                    if(parsres.code == 0){
                        top.layer.close(i);
                        top.alert(parsres.msg);
                        return ;
                    }
                    const reslocal1 = await postBodyNotHeaders(parsres.data["dyjk"],JSON.parse(parsres.data["parms"]));
                    const parsres1 = await postWebCustom(getTableId("908"),{mapset:JSON.stringify(parsres.data),res:JSON.stringify(reslocal1)});
                    top.data.parsres1 = parsres1;
                    if(parsres1.code == 0){
                        top.layer.close(i);
                        top.alert(parsres1.msg);
                        return ;
                    }

                    try {
                        if(reslocal1.result == 1 && reslocal1.meters[0].zhuangtai ==0){
                            shangci_shuaka = true;
                        }else {
                            shangci_shuaka = false;
                        }
                    }catch (e){}

                    userCode = parsres1.data.userCode;

                }else {
                    console.log(listurl[0]["dyjk"]);
                    const reslocal = await postBodyNotHeaders(listurl[0]["dyjk"],JSON.parse(listurl[0]["parms"]));
                    const parsres = await postWebCustom(getTableId("908"),{mapset:JSON.stringify(listurl[0]),res:JSON.stringify(reslocal)});
                    top.data.parsres1 = parsres;
                    if(parsres.code == 0){
                        top.layer.close(i);
                        top.alert(parsres.msg);
                        return ;
                    }

                    if(listurl[0]["dkyz"] != undefined && listurl[0]["dkyz"] != ""){
                        if(!eval(listurl[0]["dkyz"])){
                            top.layer.close(i);
                            top.alert("水卡上次未刷表，请刷表后再购水！");
                            shangci_shuaka = false;
                            // return ;
                        }
                    }

                    userCode = parsres.data.userCode;
                }

                try {
                    //查询相关的客户信息
                    let rightuserCode = userCode;
                    if(rightuserCode.indexOf("-")!=-1){
                        rightuserCode = rightuserCode.split("-")[1];
                    }
                    vm.searchInputDtos["user_code"].values = [rightuserCode];
                    vm.searchInputDtos["user_code"].type = "6";
                    vm.searchInputDtos["kplx"].values = [kid];
                    vm.getListdata();

                    vm.searchInputDtos["user_code"].type = "0";
                    vm.searchInputDtos["user_code"].value = rightuserCode;
                }catch (e){}



                //开始充值
                fun.chongzhi(userCode,kid,shangci_shuaka);

            },
            //开户
            async f_add(o) {

                let item = $(o).attr("item");
                item = JSON.parse(item);
                let ids = this.multipleSelection;

                let other = {
                    ids: "" + ids,
                    treeNode: top.data.treeNodeObj,
                    tableId: item.mapzygl.id,
                    input_id:item.mapzygl.input_id,
                    listother:top.data.listother,
                    type:"add"
                }
                top.data.other = other;
                top.data.param = other;
                top.data.buttonsItem = item.mapzygl;

                let btn = {
                    btn: ['确定','关闭']
                    , yes: async function (index, layero) {
                        console.log(layero);
                        //按钮【按钮一】的回调
                        var win = getTopIframe(layero);
                        let issubmit = win.verification();
                        if (!issubmit) {
                            return false;
                        }
                        let data = win.getData();
                        data.id = "";
                        let i = top.load();
                        //调用开户接口
                        let kplx = Object.values(data)[1]["kplx"];
                        const khlocal = await postWebCustom(getTableId("906"),{kid:kplx,fromdata:JSON.stringify(data)});
                        if(khlocal.code == 0){
                            top.layer.close(i);
                            top.alert(khlocal.msg);
                            return ;
                        }

                        //开始调用本地读写卡服务
                        const reskh = await postBodyNotHeaders(khlocal.data.dyjk,JSON.parse(khlocal.data.parms));
                        const parsres2 = await postWebCustom(getTableId("908"),{mapset:JSON.stringify(khlocal.data),res:JSON.stringify(reskh)});
                        if(parsres2.code == 0){
                            top.layer.close(i);
                            top.alert(parsres2.msg);
                            return ;
                        }

                        //开始保存数据库
                        let map1 = Object.values(data)[1];
                        map1["sys_code"] = khlocal.data.sysCode;
                        map1["user_code"] = khlocal.data.userCode;
                        let key1 = Object.keys(data)[1];
                        data[key1] = map1;
                        other.type = "add";
                        postBody("/admin/api/DataManagementController/add", {
                            tableId: item.mapzygl.id,
                            mapdata: data,
                            other: other
                        }, function (res) {
                            if(res.data != undefined){
                                vm.dataid = res.data.id;
                            }
                            top.layer.closeAll();
                            top.alert(res.msg);
                            vm.getListdata();
                        })
                    }
                    ,btn2:function (index,layero){
                        console.log("关闭按钮");
                    }
                };

                let inputurl = "/admin/html/dataManagement/input.html";
                if (item.mapzygl.url != "") {
                    inputurl = item.mapzygl.url;
                }else {
                    if(item.is_input == "1"){
                        inputurl = "/admin/html/dataManagement/input.html";
                    }
                    if(item.is_input == "2"){
                        top.data.zygl_id = item.custom_data_zygl_id;
                        top.data.tableId = item.custom_data_zygl_id;
                        top.data.orderCol = "id";
                        inputurl = "/admin/html/dataManagement/list.html";
                    }
                    if(item.mapzygl.input_id != ""){
                        top.data.zygl_id = item.custom_data_zygl_id;
                        top.data.tableId = item.custom_data_zygl_id;
                        inputurl = "/admin/html/inputCustom/index.html";
                    }
                }

                top.data.input_id = item.mapzygl.input_id;
                let width = item.mapzygl.input_width;
                let height = item.mapzygl.input_height;
                const resq = await postBody("/admin/api/DataManagementController/queryDataForId",{tableId: item.mapzygl.id,other: other,ids:""+ids});
                if(resq.code == 0){
                    top.alert(resq.msg);
                    return;
                }
                top.f_layer_open_get(inputurl, width, height, function () {

                }, btn, "开户", resq.data);
            }
            ,f_view(ids){
                ids = ""+ids;
                let other = {
                    ids: "" + top.data.param.ids,
                    treeNode: top.data.treeNodeObj,
                    tableId: this.tableId,
                    input_id:"",
                    listother:top.data.listother,
                    type:"view"
                }

                top.data.other = other;
                top.data.param = other;
                if(top.data.buttonsItem != undefined){
                    top.data.buttonsItem.id = this.tableId;
                }
                postBody("/admin/api/DataManagementController/queryDataForId", {
                    ids: ""+ids,
                    tableId: vm.tableId,
                    other: other
                }, function (res) {
                    let btn = {
                        btn: ['关闭']
                        , btn2: function (index, layero) {
                            //按钮【按钮二】的回调
                            //return false 开启该代码可禁止点击该按钮关闭
                        }
                    };
                    let item = JSON.parse(res.msg);
                    let inputurl = "/admin/html/dataManagement/input.html";
                    if (item.url != "") {
                        inputurl = item.url;
                    }else {
                        if(item.is_input == "1"){
                            inputurl = "/admin/html/dataManagement/input.html";
                        }
                        if(item.is_input == "2"){
                            top.data.zygl_id = vm.tableId;
                            top.data.tableId = vm.tableId;
                            top.data.orderCol = "id";
                            inputurl = "/admin/html/dataManagement/list.html";
                        }
                        if(item.input_id != ""){
                            top.data.zygl_id = vm.tableId;
                            top.data.tableId = vm.tableId;
                            inputurl = "/admin/html/inputCustom/index.html";
                        }
                    }

                    top.data.input_id = item.input_id;
                    let width = item.input_width;
                    let height = item.input_height;
                    if(res.code == 0){
                        top.alert(res.msg);
                        return;
                    }
                    top.f_layer_open_get(inputurl, width, height, function () {

                    }, btn, "查看数据", res.data);
                })
            }
            ,f_upex(item,ids){
                ids = ""+ids;
                let other = {
                    ids: "" + top.data.param.ids,
                    treeNode: top.data.treeNodeObj,
                    tableId: item.mapzygl.id,
                    input_id:item.mapzygl.input_id,
                    listother:top.data.listother,
                    type:"update"
                }

                top.data.other = other;
                top.data.param = other;
                top.data.buttonsItem = item.mapzygl;
                postBody("/admin/api/DataManagementController/queryDataForId", {
                    ids: ids,
                    tableId: item.mapzygl.id,
                    other: other
                }, function (res) {
                    let btn = {
                        btn: ['确定', '取消']
                        , yes: function (index, layero) {
                            console.log(layero);
                            //按钮【按钮一】的回调
                            var win = getTopIframe(layero);
                            let issubmit = win.verification();
                            if (!issubmit) {
                                return;
                            }
                            let data = win.getData();
                            let mapdatasubmit = data;
                            mapdatasubmit.id = ids;
                            let i = top.layer.load();
                            postBody("/admin/api/DataManagementController/update", {
                                tableId: item.mapzygl.id,
                                mapdata: mapdatasubmit,
                                other: other
                            }, function (res) {
                                top.layer.close(i);
                                top.alert(res.msg);
                                vm.getListdata();
                            })
                        }
                        , btn2: function (index, layero) {
                            //按钮【按钮二】的回调
                            //return false 开启该代码可禁止点击该按钮关闭
                        }
                    };
                    let inputurl = "/admin/html/dataManagement/input.html";
                    if (item.mapzygl.url != "") {
                        inputurl = item.mapzygl.url;
                    }else {
                        if(item.is_input == "1"){
                            inputurl = "/admin/html/dataManagement/input.html";
                        }
                        if(item.is_input == "2"){
                            top.data.zygl_id = item.custom_data_zygl_id;
                            top.data.tableId = item.custom_data_zygl_id;
                            top.data.orderCol = "id";
                            inputurl = "/admin/html/dataManagement/list.html";
                        }
                        if(item.mapzygl.input_id != ""){
                            top.data.zygl_id = item.custom_data_zygl_id;
                            top.data.tableId = item.custom_data_zygl_id;
                            inputurl = "/admin/html/inputCustom/index.html";
                        }
                    }

                    top.data.input_id = item.mapzygl.input_id;
                    let width = item.mapzygl.input_width;
                    let height = item.mapzygl.input_height;
                    if(res.code == 0){
                        top.alert(res.msg);
                        return;
                    }
                    top.f_layer_open_get(inputurl, width, height, function () {

                    }, btn, "修改数据", res.data);
                })
            }
            , f_update(o) {
                if (this.multipleSelection.length != 1) {
                    top.alert("只能选择一条记录进行修改");
                    return;
                }

                let item = $(o).attr("item");
                item = JSON.parse(item);

                let ids = this.multipleSelection;
                this.f_upex(item,ids);
            }
            , f_delete(o) {
                let item = $(o).attr("item");
                item = JSON.parse(item);
                if (this.multipleSelection.length == 0) {
                    top.alert("请选择记录进行删除");
                    return;
                }
                let ids = this.multipleSelection;

                layer.confirm('确定要永久删除吗？', {
                    btn: ['确定', '取消'] //可以无限个按钮
                }, function (index, layero) {
                    let other = {
                        ids: "" + top.data.param.ids,
                        treeNode: top.data.treeNodeObj,
                        tableId: item.mapzygl.id,
                        listother:top.data.listother
                    }
                    top.data.other = other;
                    postBody("/admin/api/DataManagementController/delete", {
                        ids: "" + ids,
                        tableId: item.mapzygl.id,
                        other: other
                    }, function (res) {
                        top.alert(res.msg);
                        vm.getListdata();
                        layer.close(index);
                    })
                }, function (index) {
                    //按钮【按钮二】的回调
                });


            },
            f_post_confirm(o){
                let item = $(o).attr("item");
                item = JSON.parse(item);
                if(item.is_confirm == "1"){
                    layer.confirm('确定要执行此操作吗？', {
                        btn: ['确定', '取消'] //可以无限个按钮
                    }, function (index, layero) {
                        layer.close(index);
                        vm.f_post(o);
                    }, function (index) {
                        //按钮【按钮二】的回调
                    });
                }else {
                    vm.f_post(o);
                }

            }
            , f_post(o) {//自定义数据接口
                var ids = this.multipleSelection;
                let item = $(o).attr("item");
                item = JSON.parse(item);
                top.data.buttonsItem = item.mapzygl;
                if (item.is_input != 0) {
                    top.data.zygl_id = item.custom_data_zygl_id;
                    let param = {
                        treeNode: top.data.treeNodeObj,
                        ids: "" + ids,
                        tableId: item.custom_data_zygl_id,
                        mapdata:{searchInputDtos:vm.searchInputDtos}
                    }
                    top.data.param = param;
                    let i = top.load();
                    postBody("/admin/api/DataManagementController/customGetFormData", param, function (res) {
                        top.layer.close(i);
                        if(res.code == "0"){
                            top.alert(res.msg);
                            return ;
                        }

                        let btn = {
                            btn: ['确定', '取消']
                            , yes: function (index, layero) {
                                //按钮【按钮一】的回调
                                var win = getTopIframe(layero);
                                let issubmit = win.verification();
                                if (!issubmit) {
                                    return;
                                }
                                let data = win.getData();
                                data.listother = top.data.listother;
                                data["searchInputDtos"] = vm.searchInputDtos;
                                let i = top.layer.load();
                                let psubmit = {
                                    treeNode: top.data.treeNodeObj,
                                    ids: "" + ids,
                                    tableId: item.custom_data_zygl_id,
                                    mapdata: data
                                }
                                top.data.param = param;
                                postBody("/admin/api/DataManagementController/customPostData", psubmit, function (res) {
                                    top.layer.close(i);
                                    top.alert(res.msg);
                                    vm.getListdata();
                                })
                            }
                            , btn2: function (index, layero) {
                                //按钮【按钮二】的回调
                                //return false 开启该代码可禁止点击该按钮关闭
                            }
                        };
                        let openurl = item.mapzygl.url;
                        if (openurl == "") {
                            if(item.is_input == "1"){
                                openurl = "/admin/html/dataManagement/input.html";
                            }
                            if(item.is_input == "2"){
                                top.data.zygl_id = item.custom_data_zygl_id;
                                top.data.tableId = item.custom_data_zygl_id;
                                top.data.orderCol = "id";
                                openurl = "/admin/html/dataManagement/list.html";
                            }

                        }

                        if(item.mapzygl.input_id != ""){
                            openurl = "/admin/html/inputCustom/index.html";
                            top.data.zygl_id = item.custom_data_zygl_id;
                            top.data.tableId = item.custom_data_zygl_id;
                            console.log("inputid",top.data.tableId)
                        }

                        top.data.input_id = item.mapzygl.input_id;
                        let width = item.mapzygl.input_width;
                        let height = item.mapzygl.input_height;
                        top.f_layer_open_get(openurl, width, height, function () {
                            top.data.zygl_id = top.data.tableId;
                        }, btn, "提交数据", res.data);
                    })

                } else {
                    let psubmit = {
                        treeNode: top.data.treeNodeObj,
                        ids: "" + ids,
                        tableId: item.custom_data_zygl_id,
                        mapdata:{searchInputDtos:vm.searchInputDtos}
                    }
                    let i = top.layer.load();
                    postBody("/admin/api/DataManagementController/customPostData", psubmit, function (res) {
                        top.layer.close(i);
                        top.alert(res.msg);
                        vm.getListdata();
                    })
                }
            }

        },
        watch:{
            chooseArr(data){
                this.selectRow = [];
                if (data.length > 0) {
                    data.forEach((item, index) => {
                        this.selectRow.push(this.tableData.indexOf(item));
                    });
                }
            }
        }
    });
</script>
</html>